/**
    Copyright (c) 2009 yakiimo02
    Distributed under the New BSD License.
    See included license.txt or http://www.yakiimo3d.com/NewBSDLicense.txt
**/

#pragma once

#include <vector>

/**
    @brief  Data type of the data to be sorted using bitonic sort.
    @author yakiimo02
    @date    09/11/28
*/
struct BufType
{
    unsigned int n;

    inline friend bool operator<( const BufType& left, const BufType& right );
    inline friend bool operator>( const BufType& left, const BufType& right );
};

bool operator<( const BufType& left, const BufType& right )
{
    return left.n < right.n;
}

bool operator>( const BufType& left, const BufType& right )
{
    return left.n > right.n;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const UINT NUM_ELEMENTS = 512 * 512;

typedef std::vector< BufType > BufTypeVector;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
    @brief  Data to be sorted using bitonic sort.
    @author yakiimo02
    @date    09/11/28
*/
class BitonicSortData
{
public:
    void Create();

    inline BufTypeVector& GetrData() { return m_data; }

protected:
    BufTypeVector        m_data;
};

void CheckSortUp( const BufTypeVector& data );
void CheckSortDown( const BufTypeVector& data );
